package com.changgou.test;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

public class test {
    public static void main(String[] args) {
        JwtBuilder jwtBuilder = Jwts.builder()
                .setId("888")  //设置唯一编号
                .setSubject("小白") //设置主题
                .setIssuedAt(new Date())  //设置签发日期
                .signWith(SignatureAlgorithm.HS256, "itcast");//设置签名

        String compact = jwtBuilder.compact();
        System.out.println(compact);

    }
}
